<template>
	<div>
		<!-- 老代码 -->
		<!-- <el-row>
			<el-col v-for="(struct, indexAB) in structData.dataStruct" :span="24" class="line" :key="indexAB">
				<el-row>
					<el-col :span="24" class="line">
						<h4 class="ne-inen-title">标题</h4>
						<PPMForm :structData="struct" :formData="formData"></PPMForm>
					</el-col>
				</el-row>
			</el-col>
		</el-row> -->
		<!-- 新代码 -->
		<el-col v-for="(struct, indexAB) in structData.dataStruct" :span="24" class="line" :key="indexAB" :id="struct.structId">
			<el-row v-if="onoff(struct.structName, '$')">
				<el-col :span="2">
					<h4 class="ppm-label">{{ title(struct.structName, "$") }}</h4>
				</el-col>
			</el-row>
			<el-divider class="ppm-divider" v-if="onoff(struct.structName, '$')"></el-divider>
			<!-- 判断第一个子结构是不是还是一个结构类型,如果是不要加上阴影,让子结构本身进行分割 -->
			<!-- <div :class="{ 'ppm-form-shadow-box': struct.attrs[0]['components'] }"> -->
				<!-- <PPMForm :structData="struct" :formData="formData" :ruleData="ruleData" :folded="folded"></PPMForm> -->
				<component :is="proName"  :structData="struct" :formData="formData" :ruleData="ruleData" :folded="folded"></component>
			<!-- </div> -->
		</el-col>
	</div>
</template>

<script>
import ppmstructmixin from "../utils/mixin";
export default {
	name: "PPMDataPanel",
	mixins: [ppmstructmixin],
	props: {
		formData: {
			type: Object,
		},
		ruleData: {
			type: Object,
		},
		structData: {
			type: Object,
		},
		spanNum: {
			type: Number,
			default: 24,
		},
	},
	data() {
		return {
			folded: true,
			proName:''
		};
	},
	components: {
		PPMForm: () => import("./ppmForm"),
	},
	created() {
		this.proName = sessionStorage.getItem('proName')||'PPMForm'
	},
	methods: {
		nsrShow(value) {
			this.folded = value;
			
		},
	},
};
</script>
